package cn.tedu.hospitalgroupproject.server.content.service.impl;

import cn.tedu.hospitalgroupproject.server.content.dao.persist.repository.IWorkScheduleRepository;
import cn.tedu.hospitalgroupproject.server.content.pojo.entity.WorkSchedule;
import cn.tedu.hospitalgroupproject.server.content.pojo.param.WorkScheduleAddNewParam;
import cn.tedu.hospitalgroupproject.server.content.service.IWorkScheduleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 处理排班表数据的业务实现类
 *
 * @author java@tedu.cn
 * @version 1.0
 */
@Service
@Slf4j
public class WorkScheduleServiceImpl implements IWorkScheduleService {

    @Autowired
    private IWorkScheduleRepository workScheduleRepository;

    public WorkScheduleServiceImpl() {
        log.info("创建业务对象:WorkScheduleServiceImpl");
    }

    @Override
    public void addNew(WorkScheduleAddNewParam workScheduleAddNewParam) {
        log.debug("开始处理[新增排班表]业务,参数:{}",workScheduleAddNewParam);

        WorkSchedule workSchedule=new WorkSchedule();
        BeanUtils.copyProperties(workScheduleAddNewParam,workSchedule);
        workScheduleRepository.insert(workSchedule);
    }
}
